<div class="fm-content">
  <!-- 最上面标题栏 -->
  <div class="title">
    <i nz-icon [type]="'desktop'"></i>
    &nbsp;&nbsp;同步管理
  </div>
  <!-- 内容 -->
  <div class="clwork">

    <!-- 查询框 -->
    <div class="top">
      <input nz-input placeholder="区域" class="fm-input first-input" [(ngModel)]="fs.queryObject['display:like']" />
      <nz-select [(ngModel)]="fs.queryObject['lockState']" class="fm-input" (nzOpenChange)="stateDic.load('0')"
        [nzPlaceHolder]="'锁定状态'">
        <nz-option *ngFor="let option of stateDic.datas" [nzLabel]="option.display" [nzValue]="option.id">
        </nz-option>
        <nz-option *ngIf="stateDic.isLoading" nzDisabled nzCustomContent>
          <i nz-icon type="loading" class="loading-icon"></i>加载中...
        </nz-option>
      </nz-select>
      <input nz-input placeholder="锁定人" class="fm-input" [(ngModel)]="fs.queryObject['lockUserName:like']" />
      <input nz-input placeholder="锁定设备" class="fm-input" [(ngModel)]="fs.queryObject['lockEquipmentID:like']" />
      <nz-button-group>
        <button nz-button nzType="primary" (click)="fs.loadData(true)">查询</button>
        <button nz-button (click)="fs.resetQueryObject() && fs.loadData(true)">重置</button>
      </nz-button-group>
      <div class="tool-right">
        <nz-button-group>
          <button nz-button (click)="initlock()">初始化</button>
        </nz-button-group>
      </div>
    </div>

    <!--左侧栏合同列表信息-->
    <div class="left top-left">
      <nz-tree nzAsyncData (nzClick)="fs.loadDataEx($event.node.key)"
        [nzData]="proDic.treeDatas">
      </nz-tree>
    </div>

    <!-- 右则样表单主体 -->
    <div class="right top-right">
      <div class="table">
        <nz-table nzSize="middle" nzShowSizeChanger [nzShowPagination]="false" [nzFrontPagination]="false"
          [nzData]="fs.datas" [nzLoading]="fs.isLoading || fs.isDeleing">
          <thead (nzSortChange)="fs.sort($event)" nzSingleSort>
            <tr>
              <th>区域</th>
              <th>锁定状态</th>
              <th>锁定人</th>
              <th>锁定设备</th>
              <th>更新时间</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <ng-template ngFor let-data [ngForOf]="fs.datas">
              <ng-template ngFor let-item [ngForOf]="fs.expandDataCache[data.id]">
                <tr *ngIf="(item.parent&&item.parent.expand)||!(item.parent)">
                  <td [nzIndentSize]="item.level*20" [nzShowExpand]="!item.leaf" [(nzExpand)]="item.expand"
                    (nzExpandChange)="fs.collapse(item,$event)">
                    {{item.display}}
                  </td>
                  <td>{{item.lockStateName}}</td>
                  <td>{{item.lockUserName}}</td>
                  <td>{{item.lockEquipmentID}}</td>
                  <td>{{item.lastTime}}</td>
                  <td>
                    <a *ngIf="item.lockState=='2'" (nzOnConfirm)="unLock(item)" nz-popconfirm
                      nzTitle="强行解锁将导致迁出数据设备无法更新锁定数据，确认是否继续?" nzPlacement="bottomRight" class="form-button">解锁</a>
                  </td>
                </tr>
              </ng-template>
            </ng-template>
          </tbody>
        </nz-table>
      </div>
    </div>
  </div>
</div>
